'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.users.index);

  // console.log(app.serviceClasses, 'app-------')

  // app.middleware.auth()

  // 登陆
  router.post('/api/login', controller.users.login);
  // 注册
  router.post('/api/register', controller.users.register);

  // 身份权限接口
  router.get('/api/identity', controller.users.identity)


  // 增加  blogs
  router.post('/api/blogs/add', controller.blogs.add);
  // 删除
  router.delete('/api/blogs/delete', controller.blogs.delete);
  // 批量删除
  router.delete('/api/blogs/deleteAll', controller.blogs.deleteAll);
  // 修改
  router.put('/api/blogs/update/:id', controller.blogs.update);
  // 查询
  router.get('/api/blogs/findAll', controller.blogs.findAll);
  // 分页查询
  router.get('/api/blogs/page', controller.blogs.page);
  // 模糊查询
  router.get('/api/blogs/search', controller.blogs.search);
  // 时间处理

};
